package com.lightboat.system.domain.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.DateDeserializers;
import com.fasterxml.jackson.databind.ser.std.DateSerializer;
import com.lightboat.common.annotation.Excel;
import com.lightboat.common.core.domain.bo.OrderProductBo;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.SchemaProperty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 添加补货订单
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AddReplenishmentOrderRequest implements Serializable {


    /** 商品集合 */
    @SchemaProperty(name = "商品集合")
    @Excel(name = "商品集合")
    @Size(min = 1)
    @NotNull
    private List<OrderProductBo> productCollection;

    /** 组合商品IDS */
    @SchemaProperty(name = "组合商品IDS")
    @Excel(name = "组合商品IDS")
    private List<String> groupProductIds;

    /** 是否固定（1是，0否） */
    @Schema(title = "是否固定（1是，0否）")
    private Integer isFixed;

    /** 是否大单（0否 1是） */
    @SchemaProperty(name = "是否大单（0否 1是）")
    @Excel(name = "是否大单", readConverterExp = "0=否,1=是")
    private Integer isBigOrder;

    /** 是否延期发货（0否 1是） */
    @SchemaProperty(name = "是否延期发货（0否 1是）")
    @Excel(name = "是否延期发货", readConverterExp = "0=否,1=是")
    private Integer isDelayedDelivery;

    /** 订单价格 */
    @SchemaProperty(name = "订单价格")
    @Excel(name = "订单价格")
    private BigDecimal orderPrice;

    /** 实付价格 */
    @SchemaProperty(name = "实付价格")
    @Excel(name = "实付价格")
    private BigDecimal actualPrice;

    /** 代收金额 */
    @SchemaProperty(name = "代收金额")
    @Excel(name = "代收金额")
    private BigDecimal codAmount;

    /** 总金额 */
    @SchemaProperty(name = "总金额")
    @Excel(name = "总金额")
    private BigDecimal totalAmount;

    /** 转订单金额 */
    @SchemaProperty(name = "转订单金额")
    @Excel(name = "转订单金额")
    private BigDecimal transferOrderAmount;

    /** 平台 */
    @SchemaProperty(name = "平台")
    @Excel(name = "平台")
    private String platform;

    /** 订单备注 */
    @SchemaProperty(name = "订单备注")
    @Excel(name = "订单备注")
    private String orderRemark;

    /** 关联订单ID */
    @SchemaProperty(name = "关联订单ID")
    @Excel(name = "关联订单ID")
    @NotNull
    private String relatedOrderId;

    /** 补单类型 */
    @SchemaProperty(name = "补单类型")
    @Excel(name = "补单类型")
    private String replenishOrderType;

    /** 下单时间 */
    @SchemaProperty(name = "下单时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonDeserialize(using = DateDeserializers.DateDeserializer.class)
    @JsonSerialize(using = DateSerializer.class)
    @Excel(name = "下单时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date orderTime;

    /** 物流编号 */
    @SchemaProperty(name = "物流编号,shippingType = 2时必填")
    private String logisticsNo;

    @SchemaProperty(name = "物流平台编码,shippingType = 2时必填")
    private String logisticsPlatformCode;

    @NotNull(message = "发货类型不能为空")
    @SchemaProperty(name = "发货类型  1 系统发货 2 自主发货，都是我给你传的")
    private Integer shippingType;

}
